class Solution {
public:
    int sumOddLengthSubarrays(vector<int>& arr) {
        int result=0;
        for(int step=0;step<arr.size();step+=2){
            for(int i=0;i<arr.size()-step;i++){
                for(int n=i,j=n+step;n<=j;n++){
                    result+=arr[n];
                }
            }
        }
        return result;
    }
};
